<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdTasksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ad_tasks', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->nullable();
            $table->text('content')->nullable();
            $table->integer('target_read_amount')->default(0);
            $table->integer('valid_read_amount')->default(0);
            $table->integer('status')->index()->default('1');
            $table->integer('enable')->index()->default('1');
            $table->integer('user_id')->index();
            $table->integer('type')->index()->default(1);
            $table->integer('live_time')->default(15);
            $table->json('pictures')->nullable();
            $table->text('urls')->nullable();
            $table->string('link')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ad_tasks');
    }
}
